#include <iostream>
#include <string>

using namespace std;

class Person
{
public:
    Person() { cout << "Person::Person()\n"; }
    ~Person() { cout << "Person::~Person()\n"; }
};

class Student : public Person
{
public:
    Student() : p(new char[10]) { cout << "Student::Student()\n"; }
    ~Student() { cout << "Student::~Student()\n"; delete p; p = nullptr; }
private:
    char* p;
};


int main()
{
    Person *stu = new Student;
    delete stu;
    stu = nullptr;
    return 0;
}